package com.cyl.h5.controller;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cyl.h5.config.SecurityUtil;
import com.cyl.h5.domain.vo.H5ProductVO;
import com.cyl.manager.act.domain.query.MemberCouponTjQuery;
import com.cyl.manager.act.domain.vo.MemberCouponTjVO;
import com.cyl.manager.act.mapper.MemberCouponMapper;
import com.cyl.manager.act.service.CouponActivityNewService;
import com.cyl.manager.act.service.CouponActivityService;
import com.cyl.manager.aws.service.ShopStatisticsService;
import com.cyl.manager.pms.convert.ProductConvert;
import com.cyl.manager.pms.domain.entity.Product;
import com.cyl.manager.pms.domain.query.ProductQuery;
import com.cyl.manager.pms.service.ProductService;
import com.cyl.manager.ums.domain.entity.Member;
import com.cyl.manager.ums.service.MemberService;
import com.cyl.manager.ums.service.MemberWechatService;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.config.LocalDataUtil;
import com.ruoyi.system.domain.SysOperLog;
import com.ruoyi.system.domain.vo.SysDeptDpVo;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysOperLogService;

import cn.hutool.core.date.DateUtil;

/**
 * h5/微信
 */
@RestController
@RequestMapping("")
public class ZtextController3  extends BaseController{
    @Autowired
    private MemberWechatService memberWechatService;
    @Autowired
    private H5ShopController h5ShopController;
    
    @Autowired
    private MemberService memberService;
    
    @Autowired
    private ShopStatisticsService shopStatisticsService;
    @Autowired
    private ProductService productService;
    @Autowired
    private ProductConvert productConvert;

    @Autowired
    private ISysDeptService deptService;
    @Autowired
    private ISysOperLogService operLogService;
    
    
    @Autowired
    private CouponActivityNewService couponActivityNewService;
    
 
    @Autowired
    private CouponActivityService couponActivityService;
    
    @Autowired
    private  MemberCouponMapper memberCouponMapper;
    
//    @GetMapping("/no-auth/selectMemberCouponGrepDp")
//    public ResponseEntity<List<MemberCouponTjVO>> selectMemberCouponGrepDp(MemberCouponTjQuery mctq) {
//        return ResponseEntity.ok(memberCouponMapper.selectMemberCouponGrepDp(mctq));
//    }
//    
//    @GetMapping("/no-auth/selectMemberCouponGrepMember")
//    public ResponseEntity<List<MemberCouponTjVO>> selectMemberCouponGrepMember(MemberCouponTjQuery mctq) {
//        return ResponseEntity.ok(memberCouponMapper.selectMemberCouponGrepMember(mctq));
//    }
//    
//    @PostMapping("/no-auth/list")
//    public ResponseEntity<Page<H5ProductVO>> queryGoodByPage(@RequestBody ProductQuery query, Pageable page) {
// 
//        query.setPublishStatus(1);
//       
//        List<Product> pageRes = productService.selectList(query, page);
//        return ResponseEntity.ok(new PageImpl<>(productConvert.dos2dtos(pageRes), page, ((com.github.pagehelper.Page) pageRes).getTotal()));
//    }
//    
    
//    
    
    
//    @GetMapping("/no-auth/receiveByZbjScq")
//    public ResponseEntity<Map<String, Object>> receiveByZbjScq(Long id,Long memberId) {
//        return ResponseEntity.ok(couponActivityNewService.receiveCouponScq(id,memberId));
//    }
//    
//    
//    @GetMapping("/no-auth/receiveByZbjFlq")
//    public ResponseEntity<Boolean> receiveByZbjFlq(Long id,Long memberId) {
//        return ResponseEntity.ok(couponActivityNewService.receiveCouponByFlq(id,memberId));
//    }
    
    @GetMapping("/no-auth/sleep")
    public ResponseEntity<Boolean> sleep() {
    	try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
        return ResponseEntity.ok(true);
    }
    
    
//    @GetMapping("/no-auth/max")
//    public ResponseEntity<Object> selectMaxCreateTime() {
//        return ResponseEntity.ok(shopStatisticsService.selectMaxCreateTime());
//    }
     
}
